package by.gravity.drive_track;

import by.gravity.common.CoreApplication;
import by.gravity.common.cache.db.ModelCacheManager;
import by.gravity.drive_track.provider.DriveNTrackProvider;

public class DriveApplication extends CoreApplication {
	private DriveNTrackProvider mProvider;

	private ModelCacheManager mCacheManager;

	@Override
	public void onCreate() {
		super.onCreate();
		mProvider = new DriveNTrackProvider(getApplicationContext());
		mCacheManager = new ModelCacheManager(getApplicationContext());
	}

	@Override
	public Object getSystemService(String name) {
		if (name.equals(DriveNTrackProvider.DRIVE_N_TRACK_PROVIDER)) {
			return mProvider;
		} else if (name.equals(ModelCacheManager.MODEL_CACHE_MANAGER)) {
			return mCacheManager;
		}
		return super.getSystemService(name);
	}

}
